package com.extsci.webmail.common.entity.http;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 响应类
 * @author ccoke
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ObjectRestResponse<T> {

    private String code;

    private String message;

    private T data;


    public ObjectRestResponse(ResponseStatus status, T data){
        this.code = status.getCode();
        this.message = status.getMessage();
        this.data = data;
    }

    public ObjectRestResponse(ResponseStatus status){
        this.code = status.getCode();
        this.message = status.getMessage();
        this.data = null;
    }
}
